﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="AddProducts.aspx.vb" Inherits="Ntoulagiannakis.AddProducts" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    
    <style type="text/css">
        .style1
        {
            width: 120px;
        }
    </style>
    
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="server">

<h2>Add Product</h2>
 <table>
            <tr>
                <td class="style1">Product Name</td>
                <td>
                    <asp:TextBox ID="tb_ProductName" runat="server"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tb_ProductName" CssClass="field-validation-error" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">Category</td>
                <td>
                    <asp:DropDownList ID="ddl_Category" runat="server" AutoPostBack="True" 
                        DataSourceID="SqlDataSource1" DataTextField="Category" 
                        DataValueField="Category">
                    </asp:DropDownList>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:NtoulagiannakisConnectionString %>" 
                        ProviderName="<%$ ConnectionStrings:NtoulagiannakisConnectionString.ProviderName %>" 
                        SelectCommand="SELECT * FROM [Categories]"></asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td class="style1">Sub Category</td>
                <td>
                    <asp:DropDownList ID="ddl_SubCategory" runat="server">
                    </asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td class="style1">Description</td>
                <td>
                    <asp:TextBox ID="tb_Description" runat="server" TextMode="MultiLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ControlToValidate="tb_Description" CssClass="field-validation-error" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">Dimensions</td>
                <td>
                    <asp:TextBox ID="tb_Dimensions" runat="server" TextMode="MultiLine"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="tb_Dimensions" CssClass="field-validation-error" ErrorMessage="*"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td class="style1">Picture</td>
                <td>
                    <asp:FileUpload ID="f_Picture" runat="server" />
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="f_Picture" CssClass="field-validation-error" ErrorMessage="*"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="f_Picture" CssClass="field-validation-error" ErrorMessage="Not valid Picture format" ValidationExpression="^.*\.(jpg|JPG|gif|GIF|png|PNG|bmp|BMP)$"></asp:RegularExpressionValidator>
                </td>
            </tr>
        </table>
        <br />
        <br />

        <asp:Button ID="btn_AddProduct" runat="server" Text="Add Product"/>
       
</asp:Content>
